.class public final Lcom/burstly/jackson/map/util/EnumValues;
.super Ljava/lang/Object;
.source "EnumValues.java"


# instance fields
.field private final _values:Ljava/util/EnumMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/EnumMap",
            "<*",
            "Lcom/burstly/jackson/io/SerializedString;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method private constructor <init>(Ljava/util/Map;)V
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/Enum",
            "<*>;",
            "Lcom/burstly/jackson/io/SerializedString;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 21
    .local p1, v:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/Enum<*>;Lcom/burstly/jackson/io/SerializedString;>;"
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 22
    new-instance v0, Ljava/util/EnumMap;

    invoke-direct {v0, p1}, Ljava/util/EnumMap;-><init>(Ljava/util/Map;)V

    iput-object v0, p0, Lcom/burstly/jackson/map/util/EnumValues;->_values:Ljava/util/EnumMap;

    .line 23
    return-void
.end method

.method public static construct(Ljava/lang/Class;Lcom/burstly/jackson/map/AnnotationIntrospector;)Lcom/burstly/jackson/map/util/EnumValues;
    .locals 1
    .parameter
    .parameter "intr"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Class",
            "<",
            "Ljava/lang/Enum",
            "<*>;>;",
            "Lcom/burstly/jackson/map/AnnotationIntrospector;",
            ")",
            "Lcom/burstly/jackson/map/util/EnumValues;"
        }
    .end annotation

    .prologue
    .line 27
    .local p0, enumClass:Ljava/lang/Class;,"Ljava/lang/Class<Ljava/lang/Enum<*>;>;"
    invoke-static {p0, p1}, Lcom/burstly/jackson/map/util/EnumValues;->constructFromName(Ljava/lang/Class;Lcom/burstly/jackson/map/AnnotationIntrospector;)Lcom/burstly/jackson/map/util/EnumValues;

    move-result-object v0

    return-object v0
.end method

.method public static constructFromName(Ljava/lang/Class;Lcom/burstly/jackson/map/AnnotationIntrospector;)Lcom/burstly/jackson/map/util/EnumValues;
    .locals 8
    .parameter
    .parameter "intr"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Class",
            "<",
            "Ljava/lang/Enum",
            "<*>;>;",
            "Lcom/burstly/jackson/map/AnnotationIntrospector;",
            ")",
            "Lcom/burstly/jackson/map/util/EnumValues;"
        }
    .end annotation

    .prologue
    .line 35
    .local p0, enumClass:Ljava/lang/Class;,"Ljava/lang/Class<Ljava/lang/Enum<*>;>;"
    invoke-static {p0}, Lcom/burstly/jackson/map/util/ClassUtil;->findEnumType(Ljava/lang/Class;)Ljava/lang/Class;

    move-result-object v0

    .line 36
    .local v0, cls:Ljava/lang/Class;,"Ljava/lang/Class<+Ljava/lang/Enum<*>;>;"
    invoke-virtual {v0}, Ljava/lang/Class;->getEnumConstants()[Ljava/lang/Object;

    move-result-object v4

    check-cast v4, [Ljava/lang/Enum;

    .line 37
    .local v4, values:[Ljava/lang/Enum;
    if-eqz v4, :cond_1

    .line 39
    new-instance v2, Ljava/util/HashMap;

    invoke-direct {v2}, Ljava/util/HashMap;-><init>()V

    .line 40
    .local v2, map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/Enum<*>;Lcom/burstly/jackson/io/SerializedString;>;"
    array-length v6, v4

    const/4 v5, 0x0

    :goto_0
    if-lt v5, v6, :cond_0

    .line 44
    new-instance v5, Lcom/burstly/jackson/map/util/EnumValues;

    invoke-direct {v5, v2}, Lcom/burstly/jackson/map/util/EnumValues;-><init>(Ljava/util/Map;)V

    return-object v5

    .line 40
    :cond_0
    aget-object v1, v4, v5

    .line 41
    .local v1, en:Ljava/lang/Enum;,"Ljava/lang/Enum<*>;"
    invoke-virtual {p1, v1}, Lcom/burstly/jackson/map/AnnotationIntrospector;->findEnumValue(Ljava/lang/Enum;)Ljava/lang/String;

    move-result-object v3

    .line 42
    .local v3, value:Ljava/lang/String;
    new-instance v7, Lcom/burstly/jackson/io/SerializedString;

    invoke-direct {v7, v3}, Lcom/burstly/jackson/io/SerializedString;-><init>(Ljava/lang/String;)V

    invoke-interface {v2, v1, v7}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 40
    add-int/lit8 v5, v5, 0x1

    goto :goto_0

    .line 46
    .end local v1           #en:Ljava/lang/Enum;,"Ljava/lang/Enum<*>;"
    .end local v2           #map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/Enum<*>;Lcom/burstly/jackson/io/SerializedString;>;"
    .end local v3           #value:Ljava/lang/String;
    :cond_1
    new-instance v5, Ljava/lang/IllegalArgumentException;

    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "Can not determine enum constants for Class "

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v5
.end method

.method public static constructFromToString(Ljava/lang/Class;Lcom/burstly/jackson/map/AnnotationIntrospector;)Lcom/burstly/jackson/map/util/EnumValues;
    .locals 8
    .parameter
    .parameter "intr"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Class",
            "<",
            "Ljava/lang/Enum",
            "<*>;>;",
            "Lcom/burstly/jackson/map/AnnotationIntrospector;",
            ")",
            "Lcom/burstly/jackson/map/util/EnumValues;"
        }
    .end annotation

    .prologue
    .line 51
    .local p0, enumClass:Ljava/lang/Class;,"Ljava/lang/Class<Ljava/lang/Enum<*>;>;"
    invoke-static {p0}, Lcom/burstly/jackson/map/util/ClassUtil;->findEnumType(Ljava/lang/Class;)Ljava/lang/Class;

    move-result-object v0

    .line 52
    .local v0, cls:Ljava/lang/Class;,"Ljava/lang/Class<+Ljava/lang/Enum<*>;>;"
    invoke-virtual {v0}, Ljava/lang/Class;->getEnumConstants()[Ljava/lang/Object;

    move-result-object v3

    check-cast v3, [Ljava/lang/Enum;

    .line 53
    .local v3, values:[Ljava/lang/Enum;
    if-eqz v3, :cond_1

    .line 55
    new-instance v2, Ljava/util/HashMap;

    invoke-direct {v2}, Ljava/util/HashMap;-><init>()V

    .line 56
    .local v2, map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/Enum<*>;Lcom/burstly/jackson/io/SerializedString;>;"
    array-length v5, v3

    const/4 v4, 0x0

    :goto_0
    if-lt v4, v5, :cond_0

    .line 59
    new-instance v4, Lcom/burstly/jackson/map/util/EnumValues;

    invoke-direct {v4, v2}, Lcom/burstly/jackson/map/util/EnumValues;-><init>(Ljava/util/Map;)V

    return-object v4

    .line 56
    :cond_0
    aget-object v1, v3, v4

    .line 57
    .local v1, en:Ljava/lang/Enum;,"Ljava/lang/Enum<*>;"
    new-instance v6, Lcom/burstly/jackson/io/SerializedString;

    invoke-virtual {v1}, Ljava/lang/Enum;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Lcom/burstly/jackson/io/SerializedString;-><init>(Ljava/lang/String;)V

    invoke-interface {v2, v1, v6}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 56
    add-int/lit8 v4, v4, 0x1

    goto :goto_0

    .line 61
    .end local v1           #en:Ljava/lang/Enum;,"Ljava/lang/Enum<*>;"
    .end local v2           #map:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/Enum<*>;Lcom/burstly/jackson/io/SerializedString;>;"
    :cond_1
    new-instance v4, Ljava/lang/IllegalArgumentException;

    new-instance v5, Ljava/lang/StringBuilder;

    const-string v6, "Can not determine enum constants for Class "

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v4
.end method


# virtual methods
.method public serializedValueFor(Ljava/lang/Enum;)Lcom/burstly/jackson/io/SerializedString;
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Enum",
            "<*>;)",
            "Lcom/burstly/jackson/io/SerializedString;"
        }
    .end annotation

    .prologue
    .line 76
    .local p1, key:Ljava/lang/Enum;,"Ljava/lang/Enum<*>;"
    iget-object v0, p0, Lcom/burstly/jackson/map/util/EnumValues;->_values:Ljava/util/EnumMap;

    invoke-virtual {v0, p1}, Ljava/util/EnumMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/jackson/io/SerializedString;

    return-object v0
.end method

.method public valueFor(Ljava/lang/Enum;)Ljava/lang/String;
    .locals 2
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Enum",
            "<*>;)",
            "Ljava/lang/String;"
        }
    .end annotation

    .annotation runtime Ljava/lang/Deprecated;
    .end annotation

    .prologue
    .line 70
    .local p1, key:Ljava/lang/Enum;,"Ljava/lang/Enum<*>;"
    iget-object v1, p0, Lcom/burstly/jackson/map/util/EnumValues;->_values:Ljava/util/EnumMap;

    invoke-virtual {v1, p1}, Ljava/util/EnumMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/jackson/io/SerializedString;

    .line 71
    .local v0, sstr:Lcom/burstly/jackson/io/SerializedString;
    if-nez v0, :cond_0

    const/4 v1, 0x0

    :goto_0
    return-object v1

    :cond_0
    invoke-virtual {v0}, Lcom/burstly/jackson/io/SerializedString;->getValue()Ljava/lang/String;

    move-result-object v1

    goto :goto_0
.end method

.method public values()Ljava/util/Collection;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Collection",
            "<",
            "Lcom/burstly/jackson/io/SerializedString;",
            ">;"
        }
    .end annotation

    .prologue
    .line 80
    iget-object v0, p0, Lcom/burstly/jackson/map/util/EnumValues;->_values:Ljava/util/EnumMap;

    invoke-virtual {v0}, Ljava/util/EnumMap;->values()Ljava/util/Collection;

    move-result-object v0

    return-object v0
.end method
